const user = {
  state: () => ({
    serialNo: '',
    tenantId: '',
    accessToken: '',
    expiresTime: -1,
    refreshToken: '',
    userId: ''
  }),
  mutations: {
    setSerialNo(state, payload) {
      state.serialNo = payload
    },
    setTenantId(state, payload) {
      state.tenantId = payload
    },
    setUser(state, payload) {
      const { accessToken, expiresTime, refreshToken, userId } = payload

      state.accessToken = accessToken
      state.expiresTime = expiresTime
      state.refreshToken = refreshToken
      state.userId = userId
    }
  },
  actions: {}
}

export default user
